import java.util.regex.Pattern

def getProjectList() {
    def manifestFile = file("project.properties")
    def pattern = Pattern.compile("android.library.reference.(\\d+)\\s*=\\s*(.*)")
    def matcher = pattern.matcher(manifestFile.getText())
    def projects = []
    while (matcher.find()) {
      projects.add(":" + matcher.group(2).replace("/",":"))
    }
    return projects
}

for (subproject in getProjectList()) {
    include subproject
}

include ':'
